package dnl.jexem.watchdog.cli;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;

import dnl.infra.cli.CliSetting;

public class DebugSetting extends CliSetting {

	private boolean debug;
	
	public DebugSetting() {
		OptionBuilder.withDescription(
		"runs watchdog in debug mode");
		addOption(OptionBuilder.create("debug"));
	}

	@Override
	public void extractSetting(CommandLine cmd) {
		Option option = getOption();
		debug = cmd.hasOption(option.getOpt());
	}

	public boolean isDebug(){
		return debug;
	}
}
